﻿using System.Collections.Generic;

namespace DotNetDAL.Entity.DbStruct
{
    /// <summary>
    /// 数据库表缓存 
    /// </summary>
    public class DbStructColumnCache
    {
        public string table_name { get; set; }
        public List<DbStructColumnDTO> columns { get; set; }

        public DbStructColumnCache()
        {
            columns = new List<DbStructColumnDTO>();
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="columnName"></param>
        /// <returns></returns>
        public bool IsExistColumn(string columnName)
        {
            return columns == null ? false :
                string.IsNullOrEmpty(columnName) ? false: 
                columns.FindIndex(col => col.column_name == columnName) > -1;
        }
    }
}
